Returns true with a probability of 'percent'
# File lib/utils.rb, line 6 def chance(percent) rand(100) <= percent end
Intern the string keys to a hash
# File lib/utils.rb, line 12 def hash_intern(h) h.inject({}) { |memo, (k, v)| memo[k.to_sym] = v; memo } end